<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	version="3.0">
	<display-name>simple-service</display-name>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:applicationContext.xml</param-value>
	</context-param>

	<resource-ref>
		<description>MySQL DB Connection Pool</description>
		<res-ref-name>jdbc/rest-security</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
		<res-sharing-scope>Shareable</res-sharing-scope>
	</resource-ref>

	<security-constraint>
		<web-resource-collection>
			<url-pattern>/*</url-pattern>
			<http-method>GET</http-method>
		</web-resource-collection>
		<web-resource-collection>
			<url-pattern>/webapi/*</url-pattern>
			<http-method>GET</http-method>
			<http-method>POST</http-method>
			<http-method>UPDATE</http-method>
			<http-method>DELETE</http-method>
		</web-resource-collection>
		<auth-constraint>
			<role-name>admin</role-name>
		</auth-constraint>
	</security-constraint>

	<security-constraint>
		<web-resource-collection>
			<url-pattern>/*</url-pattern>
			<http-method>GET</http-method>
		</web-resource-collection>
		<web-resource-collection>
			<url-pattern>/webapi/*</url-pattern>
			<http-method>GET</http-method>
		</web-resource-collection>
		<auth-constraint>
			<role-name>user</role-name>
		</auth-constraint>
	</security-constraint>

	<login-config>
		<auth-method>FORM</auth-method>
		<form-login-config>
			<form-login-page>/login.html</form-login-page>
			<form-error-page>/error.html</form-error-page>
		</form-login-config>
	</login-config>

	<welcome-file-list>
		<welcome-file>/index.html</welcome-file>
	</welcome-file-list>

</web-app>
